package com.study.bob.builder;

/**
 * Created by bob on 2016/5/4.
 */
public class Computer {
    private String HDD;

    private String ARM;

    private boolean isGraphicCardEnable;

    private boolean isBluetoothEnable;



    private Computer(ComputerBuilder builder){
        this.ARM = builder.ARM;
        this.HDD = builder.HDD;
        this.isGraphicCardEnable = builder.isGraphicCardEnable;
        this.isBluetoothEnable = builder.isBluetoothEnable;
    }

    public String getHDD() {
        return HDD;
    }

    public String getARM() {
        return ARM;
    }

    public boolean isGraphicCardEnable() {
        return isGraphicCardEnable;
    }

    public boolean isBluetoothEnable() {
        return isBluetoothEnable;
    }


    public static class ComputerBuilder{
        private String HDD;

        private String ARM;

        private boolean isGraphicCardEnable;

        private boolean isBluetoothEnable;


        public ComputerBuilder(String hdd,String arm){
            this.HDD = hdd;
            this.ARM = arm;
        }

        public ComputerBuilder setIsGraphicCardEnable(boolean isGraphicCardEnable){
            this.isGraphicCardEnable = isGraphicCardEnable;
            return this;
        }


        public ComputerBuilder setIsBluetoothEnable(boolean isBluetoothEnable){
            this.isBluetoothEnable = isBluetoothEnable;
            return this;
        }

        public Computer builder(){
            return new Computer(this);
        }

    }

}
